#!/usr/bin/env bash
set -e

function get_dir(){
    for element in `ls $1`
    do
        dir_or_file=$1"/"${element}
        if [ -d ${dir_or_file} ]
        then
            get_dir ${dir_or_file}
        else
            if [ "${element}" = "deploy.sh" ]; then
                echo "当前执行部署: $1"
                cd $1
                sh ${element}
            fi

        fi
    done
}
get_dir `pwd`